package org.jeecg.modules.performance.service.impl;

import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateTimeUtil;
import org.jeecg.modules.performance.entity.PerforSpeardUser;
import org.jeecg.modules.performance.mapper.PerforSpeardUserMapper;
import org.jeecg.modules.performance.service.IPerforSpeardUserService;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Date;

/**
 * @Description: PerforSpeardUser
 * @Author: jeecg-boot
 * @Date:   2021-04-19
 * @Version: V1.0
 */
@Service
public class PerforSpeardUserServiceImpl extends ServiceImpl<PerforSpeardUserMapper, PerforSpeardUser> implements IPerforSpeardUserService {

    @Override
    public void add(PerforSpeardUser perforSpeardUser) {
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        perforSpeardUser.setCreateTime(new Date());
        perforSpeardUser.setRefUserId(sysUser.getId());
        perforSpeardUser.setRefTime(DateTimeUtil.getTodayChar6());
        //todo

//        perforSpeardUser.setPerforConfigId();
//        perforSpeardUser.setPerforConfigScore();
        this.save(perforSpeardUser);
    }
}
